﻿using System.Collections;
using System.IO;
using UnityEngine;

namespace Assets.Scripts
{
    public class PanelBoard : MonoBehaviour
    {
        public int row;
        public int col;
        public int gap;

        public RectTransform cellGroup;
        public RectTransform[] cellPrefabs;

        public RectTransform[] producerPrefabs;

        private void Start()
        {
        }
        [ContextMenu("Reposition")]
        public void GenerateChessBoard()
        {
            for (int i = 0; i < col; i++)
            {
                for (int j = 0; j < row; j++)
                {
                    var cell =  GameObject.Instantiate<RectTransform>(ChooseCellPrefab(i + j));
                    cell.SetParent(cellGroup,false);
                }
            }
        }

        public RectTransform ChooseCellPrefab(int index)
        {
            index = index % 2;
            return cellPrefabs[index];
        }

        public void RandomCreateOriginCheeses()
        {

        }
    }
}